class question3_3{
public static void main(String args[]){
	double sum=0,a=1,i=1;
	do { sum=sum+a;
		i++;
		a=(1.0/i)*a;
	}
	while (i<=20);
	System.out.println("do循环计算"+sum);
	for (sum=0,i=1,a=1;i<=20;i++){
	a=a*(1.0/i);
	sum=sum+a;
	}
	System.out.println("使用for计算"+sum);
	}
}
